﻿@model PSU.Model.Areas.Student.GoodsViewModel
@{
    Layout = null;
    ViewData["Title"] = "选择物品";
    ViewData["NavTitle"] = "入学报名";
}

<section class="content">
    <div class="row">
        <table class="table table-bordered table-striped table-responsive">
            <thead>
                <tr>
                    <th class="text-center">序号</th>
                    <th class="text-center">编号</th>
                    <th class="text-center">物品名称</th>
                    <th class="text-center">物品描述</th>
                    <th class="text-center">物品尺寸</th>
                    <th class="text-center">操作</th>
                </tr>
            </thead>
            <tbody class="text-center">
                @if (Model.GoodsList != null && Model.GoodsList.Any())
                {
                    int index = 1;
                    foreach (var item in Model.GoodsList.AsReadOnly())
                    {
                        <tr>
                            <td>@index</td>
                            <td>@item.Id</td>
                            <td>@item.Name</td>
                            <td>@item.Description</td>
                            <td>@item.Size</td>
                            <td>
                                <a id="goods_detail" href="javascript:void(0)" data-id="@item.Id">物品详情</a>
                                @if (item.IsChosen)
                                {
                                    <a id="book_goodsInfo" href="javascript:void(0)" data-id="@item.Id" data-booking="@item.IsChosen">选择物品详情</a>
                                }
                                else
                                {
                                    <a id="book_goods" href="javascript:void(0)" data-id="@item.Id" data-booking="@item.IsChosen">选择物品</a>
                                }

                            </td>
                        </tr>
                        index++;
                    }
                }
                else
                {
                    <tr>
                        <td colspan="6">Ops,暂无物品信息~~~</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</section>
